from django.shortcuts import render,HttpResponse
from .models import Message

# Create your views here.
def message_form(request):
    return render(request, 'message_form.html')

def message_list(request):
    user_list = Message.objects.all()  # 获取表所有的数据
    # 只要是QuerySet就可以点query查看获取到当前QuerySet对象的内部sql语句
    print(user_list.query)
    return HttpResponse(user_list.query)